<template>
  <div class="page" style="">
    <div v-if="formData.billNo && formData.billNo.substring(0, 2) == 'ZF'" class="print_title">报告审核单作废详情 · 禾美环保</div>
    <div v-else class="print_title">报告审核单详情 · 禾美环保</div>
    <p class="title">基本信息</p>
    <a-row type="flex" justify="start" class="content" style="padding: 0 9px;">
      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">单据编号:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.billNo }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12">
        <a-row>
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">申请人:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.handlerId_dictText }}</p>
          </a-col>
        </a-row>
      </a-col>

      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">申请部门:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.handlerDeptId_dictText }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">申请时间:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.createTime }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12" v-if="formData.billNo && formData.billNo.substring(0, 2) == 'ZF'">
          <a-row style="margin-bottom: 0">
            <a-col style="display: flex;">
              <p style="margin-bottom: 0; white-space: nowrap">报告审核单:</p>
              <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.purchaseBillId_dictText }}</p>
            </a-col>
          </a-row>
        </a-col>
      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">项目名称:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.projectId_dictText }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">项目编号:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.finalNo }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12" v-if="formData.taskId_dictText">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">关联任务:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.taskId_dictText }}</p>
          </a-col>
        </a-row>
      </a-col>

      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">业务名称:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.categoryName }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">项目负责人:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.projectLeading_dictText }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">生产团队:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.productTeam_dictText }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">实施部门:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.executeDepart_dictText }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">资质单位:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.qualificationUnit_dictText }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">签订单位:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.signUnit_dictText }}</p>
          </a-col>
        </a-row>
      </a-col>

      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">项目所在地址:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ getAddress(formData.areaCode) }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">项目所在详细地址:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.projectAddress }}</p>
          </a-col>
        </a-row>
      </a-col>
      <!-- <template v-if="formData.hideFlag == 1">
        <a-col :span="12">
          <a-row style="margin-bottom: 0">
            <a-col style="display: flex;">
              <p style="margin-bottom: 0; white-space: nowrap">行业类别:</p>
              <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.industryCategory_dictText }}</p>
            </a-col>
          </a-row>
        </a-col>
        <a-col :span="12">
          <a-row style="margin-bottom: 0">
            <a-col style="display: flex;">
              <p style="margin-bottom: 0; white-space: nowrap">行业系数:</p>
              <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.industryCoefficient }}</p>
            </a-col>
          </a-row>
        </a-col>
        <a-col :span="12">
          <a-row style="margin-bottom: 0">
            <a-col style="display: flex;">
              <p style="margin-bottom: 0; white-space: nowrap">审批类别:</p>
              <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.approvalLevel_dictText }}</p>
            </a-col>
          </a-row>
        </a-col>
        <a-col :span="12">
          <a-row style="margin-bottom: 0">
            <a-col style="display: flex;">
              <p style="margin-bottom: 0; white-space: nowrap">审批系数:</p>
              <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.approvalCoefficient }}</p>
            </a-col>
          </a-row>
        </a-col>

        <a-col :span="12">
          <a-row style="margin-bottom: 0">
            <a-col style="display: flex;">
              <p style="margin-bottom: 0; white-space: nowrap">复杂程度:</p>
              <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.complexity_dictText }}</p>
            </a-col>
          </a-row>
        </a-col>
        <a-col :span="12">
          <a-row style="margin-bottom: 0">
            <a-col style="display: flex;">
              <p style="margin-bottom: 0; white-space: nowrap">复杂系数:</p>
              <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.complexCoefficient }}</p>
            </a-col>
          </a-row>
        </a-col>

      </template> -->
      
      <a-col :span="12">
          <a-row style="margin-bottom: 0">
            <a-col style="display: flex;">
              <p style="margin-bottom: 0; white-space: nowrap">任务类型:</p>
              <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.taskType_dictText }}</p>
            </a-col>
          </a-row>
        </a-col>



        <a-col :span="12" v-if="formData.reviewResult_dictText">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">项目评审情况:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.reviewResult_dictText }}</p>
          </a-col>
        </a-row>
      </a-col>

      <a-col :span="24">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">任务最终成果报告名称(全称):</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.projectResult }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12" v-if="formData.reportType_dictText">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">报告类型:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.reportType_dictText }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12" v-if="formData.feeTeamId_dictText">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">费用所属团队:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.feeTeamId_dictText }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="24">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">备注:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.remark }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="24" v-if="formData.billNo && formData.billNo.substring(0, 2) == 'ZF'">
          <a-row style="margin-bottom: 0">
            <a-col style="display: flex;">
              <p style="margin-bottom: 0; white-space: nowrap">作废说明:</p>
              <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.invalidRemark }}</p>
            </a-col>
          </a-row>
        </a-col>

      <!-- <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">工程师(二审):</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.engineerSecondReview_dictText }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">工程师(三审):</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.engineerThirdReview_dictText }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">项目评审情况:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.reviewResult_dictText }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">二审审核费:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.secondReviewFee }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">专审人员:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.specializedAuditors_dictText }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="24">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">二审审核费计算过程:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.secondReviewProcess }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">三审审核费:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.thirdReviewFee }}</p>
          </a-col>
        </a-row>
      </a-col>
      <a-col :span="24">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">三审审核费计算过程:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.thirdReviewProcess }}</p>
          </a-col>
        </a-row>
      </a-col> -->
      <!-- <a-col :span="12">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">项目评审情况:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.reviewResult_dictText }}</p>
          </a-col>
        </a-row>
      </a-col> -->


    </a-row>

    <a-row type="flex" justify="center" v-if="formData.firstAuditEngineers" class="performance_information">
      <a-col>
        <p class="title_table">一审工程师</p>
      </a-col>
      <a-col :span="24">
        <a-table
          :columns="defColumns"
          :data-source="formData.firstAuditEngineers"
          bordered
          :pagination="false"
          size="small"
          ></a-table>
      </a-col>  
    </a-row>
    <a-row v-if="formData.oneRemark" type="flex" justify="start" class="content" style="padding: 0 9px;margin-top: 10px;">
      <a-col :span="24">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">备注:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.oneRemark }}</p>
          </a-col>
        </a-row>
      </a-col>
    </a-row>
    
    <FileInfor :purchaseFile="oneAttachment" title="一审任务附件" v-if="oneAttachment && oneAttachment.length"></FileInfor>
    <a-row type="flex" justify="center" v-if="formData.secondAuditChairmanEngineers" class="performance_information">
      <a-col>
        <p class="title_table">二审主持工程师</p>
      </a-col>
      <a-col :span="24">
        <a-table
          :columns="twoDefColumns"
          :data-source="formData.secondAuditChairmanEngineers"
          bordered
          :pagination="false"
          size="small"
          ></a-table>
      </a-col>
    </a-row>
    <a-row v-if="formData.twoHostRemark" type="flex" justify="start" class="content" style="padding: 0 9px;margin-top: 10px;">
      <a-col :span="24">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">备注:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.twoHostRemark }}</p>
          </a-col>
        </a-row>
      </a-col>
    </a-row>
    <FileInfor :purchaseFile="twoAttachment" title="二审主持任务附件" v-if="twoAttachment && twoAttachment.length"></FileInfor>

    <a-row type="flex" justify="center" v-if="formData.secondAuditReviewEngineers" class="performance_information">
      <a-col>
        <p class="title_table">二审会审工程师</p>
      </a-col>
      <a-col :span="24">
        <a-table
          :columns="twoDefColumns"
          :data-source="formData.secondAuditReviewEngineers"
          bordered
          :pagination="false"
          size="small"
          ></a-table>
      </a-col>
    </a-row>
    <a-row v-if="formData.twoJointReviewRemark" type="flex" justify="start" class="content" style="padding: 0 9px;margin-top: 10px;">
      <a-col :span="24">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">备注:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.twoJointReviewRemark }}</p>
          </a-col>
        </a-row>
      </a-col>
    </a-row>
    <a-row type="flex" justify="center" v-if="formData.thirdAuditEngineers" class="performance_information">
      <a-col>
        <p class="title_table">三审工程师</p>
      </a-col>
      <a-col :span="24">
        <a-table
          :columns="defColumns"
          :data-source="formData.thirdAuditEngineers"
          bordered
          :pagination="false"
          size="small"
          ></a-table>
      </a-col>
    </a-row>
    <a-row v-if="formData.threeRemark" type="flex" justify="start" class="content" style="padding: 0 9px;margin-top: 10px;">
      <a-col :span="24">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">备注:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{ formData.threeRemark }}</p>
          </a-col>
        </a-row>
      </a-col>
    </a-row>
    
    <a-row type="flex" justify="center" v-if="formData.specialistAuditPersonnel" class="performance_information">
      <a-col>
        <p class="title_table">专审人员</p>
      </a-col>
      <a-col :span="24">
        <a-table
          :columns="defColumns"
          :data-source="formData.specialistAuditPersonnel"
          bordered
          :pagination="false"
          size="small"
          ></a-table>
      </a-col>
    </a-row>
    <a-row v-if="formData.specializedRemark" type="flex" justify="start" class="content" style="padding: 0 9px;margin-top: 10px;">
      <a-col :span="24">
        <a-row style="margin-bottom: 0">
          <a-col style="display: flex;">
            <p style="margin-bottom: 0; white-space: nowrap">备注:</p>
            <p style="margin:0 0 0 6px; word-break: break-all;">{{formData.specializedRemark }}</p>
          </a-col>
        </a-row>
      </a-col>
    </a-row>

    <!-- <a-row type="flex" justify="center" v-if="dataSource && dataSource.length" class="performance_information">
      <a-col>
        <p class="title_table">绩效信息</p>
      </a-col>
      <a-col :span="24">
        <a-table
          :columns="columns"
          :data-source="dataSource"
          bordered
          :pagination="false"
          size="small"
          :rowClassName="tableRowClass"></a-table>
      </a-col>
    </a-row> -->

    <!-- 附件信息 -->
    <FileInfor :purchaseFile="purchaseFile" title="任务附件" v-if="purchaseFile && purchaseFile.length"></FileInfor>
    <!-- 流程详情 -->
    <ProcessInfor v-if="formData.bpmStatus !== '1'" :dataHistorySource="dataHistorySource"></ProcessInfor>
  </div>
</template>
<script>
import { getAction } from '@/api/manage'
import FileInfor from '@/components/print/FileInfor.vue' // 审批历史流程列表组件
import ProcessInfor from '@/components/print/ProcessInfor.vue' // 审批历史流程列表组件
import address from '@/components/AddressChoice/address.js'
import { filterMultiDictText, initDictOptions } from '@/components/dict/JDictSelectUtil'
export default {
	props: {
		formData: {
			type: Object,
			default: () => {},
			required: true
    },
		formDataHistory: {
			type: Object,
			default: () => {},
			required: true
    }
	},
  components: {
    FileInfor,
    ProcessInfor
  },
  data() {
    return {
      address,
      filterMultiDictText,
      dictOptions: {},
      dataSource: [], // 物料列表
      columns: [
				{
					title: '序号',
					dataIndex: '',
					key: 'rowIndex',
					width: 30,
					align: 'center',
					customRender: function (t, r, index) {
						return parseInt(index) + 1;
					}
				},
				{
					title: '项目名称',
					align: 'center',
					dataIndex: 'projectId_dictText'
          // customRender: (text) => {
          //   if (!text) {
          //     return ''
          //   } else {
          //     return filterMultiDictText(this.dictOptions['projectId'], text + '')
          //   }
          // }
				},
				{
					title: '业绩归属年度',
          width: 45,
					align: 'center',
					dataIndex: 'year_dictText'
          // customRender: (text) => {
          //   if (!text) {
          //     return ''
          //   } else {
          //     return filterMultiDictText(this.dictOptions['year'], text + '')
          //   }
          // }
				},
        {
					title: '签订单位',
          width: 60,
					align: 'center',
					dataIndex: 'signUnit_dictText'
          // customRender: (text) => {
          //   if (!text) {
          //     return ''
          //   } else {
          //     return filterMultiDictText(this.dictOptions['signUnit'], text + '')
          //   }
          // }
				},
        {
					title: '业务名称',
          width: 60,
					align: 'center',
					dataIndex: 'taskId_dictText'
          // customRender: (text) => {
          //   if (!text) {
          //     return ''
          //   } else {
          //     return filterMultiDictText(this.dictOptions['taskId'], text + '')
          //   }
          // }
				},
        {
					title: '费用所属团队',
          width: 50,
					align: 'center',
					dataIndex: 'feeTeamId_dictText'
          // customRender: (text) => {
          //   if (!text) {
          //     return ''
          //   } else {
          //     return filterMultiDictText(this.dictOptions['feeTeamId'], text + '')
          //   }
          // }
				},
        {
					title: '费用所属年度',
          width: 45,
					align: 'center',
					dataIndex: 'feeYear_dictText'
          // customRender: (text) => {
          //   if (!text) {
          //     return ''
          //   } else {
          //     return filterMultiDictText(this.dictOptions['feeTeamId'], text + '')
          //   }
          // }
				},
        {
            title: '合同额(元)',
            align: 'center',
            width: 40,
            dataIndex: 'contractAmount'
          },
          {
            title: '分配合同额(元)',
            align: 'center',
            width: 50,
            dataIndex: 'taskContractAmount'
          },
          {
            title: '回款额(元)',
            width: 40,
            align: 'center',
            dataIndex: 'realCollectionPaymentMoney'
          },
          {
            title: '审批级别',
            width: 30,
            align: 'center',
            dataIndex: 'approvalLevel_dictText'
            // customRender: (text, r) => {
            //   if (!text) {
            //     return ''
            //   } else {
            //     return filterMultiDictText(this.dictOptions['approvalLevel'], text + '')
            //   }
            // }
          },
          {
            title: '难易程度',
            align: 'center',
            width: 30,
            dataIndex: 'difficultyLevel_dictText'
            // customRender: (text, r) => {
            //   if (!text) {
            //     return ''
            //   } else {
            //     return filterMultiDictText(this.dictOptions['difficultyLevel'], text + '')
            //   }
            // }
          },
          {
            title: '任务进度',
            align: 'center',
            width: 55,
            dataIndex: 'progressName'
          },
          {
            title: '报告编制绩效(元)',
            width: 50,
            align: 'center',
            dataIndex: 'reportAchievements'
          },
          {
            title: '绩效提取金额(元)',
            align: 'center',
            width: 50,
            dataIndex: 'achievementsMoney'
          }
			],

      defColumns: [
        {
          title: '姓名',
          dataIndex: 'empId',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: (text) => {
          if (!text) {
            return ''
          } else {
              return filterMultiDictText(this.dictOptions['empId'], text + '')
          }
         }
        },
        {
          title: '所属团队',
          align: 'center',
          dataIndex: 'teamId',
          width: 100,
          ellipsis: true,
          customRender: (text) => {
          if (!text) {
            return ''
          } else {
              return filterMultiDictText(this.dictOptions['teamId'], text + '')
          }
         }
        },
        {
          title: '预计审核费(元)',
          align: 'center',
          dataIndex: 'expectedAuditFee',
          scopedSlots: { customRender: 'expectedAuditFee' },
          width: 140,
          ellipsis: true
        },
        {
          title: '扣除比例(%)',
          align: 'center',
          dataIndex: 'deductionRatio',
          scopedSlots: { customRender: 'deductionRatio' },
          width: 135,
          customRender: function (text) {
             return  Number(text * 100 ) + '%'
          },
          ellipsis: true
        },
        {
          title: '实际审核费(元)',
          scopedSlots: { customRender: 'actualAuditFee' },
          align: 'center',
          dataIndex: 'actualAuditFee',
          width: 120,
          ellipsis: true
        },

      ],
      twoDefColumns: [
        {
          title: '姓名',
          dataIndex: 'empId',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: (text) => {
          if (!text) {
            return ''
          } else {
              return filterMultiDictText(this.dictOptions['empId'], text + '')
          }
         }
        },
        {
          title: '所属团队',
          align: 'center',
          dataIndex: 'teamId',
          width: 100,
          ellipsis: true,
          customRender: (text) => {
          if (!text) {
            return ''
          } else {
              return filterMultiDictText(this.dictOptions['teamId'], text + '')
          }
         }
        },
        {
          title: '预计审核费(元)',
          align: 'center',
          dataIndex: 'expectedAuditFee',
          scopedSlots: { customRender: 'expectedAuditFee' },
          width: 140,
          ellipsis: true
        },
        {
          title: '扣除比例(%)',
          align: 'center',
          dataIndex: 'deductionRatio',
          scopedSlots: { customRender: 'deductionRatio' },
          customRender: function (text) {
             return  Number(text * 100 ) + '%'
          },
          width: 135,
          ellipsis: true
        },
        {
          title: '实际审核费(元)',
          scopedSlots: { customRender: 'actualAuditFee' },
          align: 'center',
          dataIndex: 'actualAuditFee',
          width: 120,
          ellipsis: true
        },
        {
          title: '签字费(元)',
          scopedSlots: { customRender: 'signatureFee' },
          align: 'center',
          dataIndex: 'signatureFee',
          width: 120,
          ellipsis: true
        },

      ],
			dataHistorySource: [], // 流程列表
			url: {
				list: '/api/erp/omc/task/achievementsextraction/erpAchievementsExtractionDt/list', // 绩效信息列表
				historyList: '/api/erpmng/act/task/processHistoryList' // 流程历史跟踪接口
			},
			purchaseFile: [], // 附件
      businessFile: [],
      oneAttachment:[],
      twoAttachment:[]
    };
  },
  created(){
     console.log(this.formData,'------formData-----');
     this.initDictConfig()
  },
	watch: {
		formData: {
			handler (val) {
				if (val) {
					// this.list()
					this.getHistoryList()
          // this.initDictConfig() // 字典值
          // 获取任务信息
          console.log(val,'打印val000000');

          // this.$nextTick(()=>{
          //   if(val.firstAuditEngineers){
          //     val.firstAuditEngineers.forEach(item=>{
          //       item.deductionRatio = Number(item.deductionRatio * 100 ) + '%'
          //     })
          //   }
          //   if(val.secondAuditChairmanEngineers){
          //     val.secondAuditChairmanEngineers.forEach(item=>{
          //       item.deductionRatio = Number(item.deductionRatio * 100 ) + '%'
          //     })
          //   }
          //   if(val.secondAuditReviewEngineers){
          //     val.secondAuditReviewEngineers.forEach(item=>{
          //       item.deductionRatio = Number(item.deductionRatio * 100 ) + '%'
          //     })
          //   }
          //   if(val.thirdAuditEngineers){
          //     val.thirdAuditEngineers.forEach(item=>{
          //       item.deductionRatio = Number(item.deductionRatio * 100 ) + '%'
          //     })
          //   }
          //   if(val.specialistAuditPersonnel){
          //     val.specialistAuditPersonnel.forEach(item=>{
          //       item.deductionRatio = Number(item.deductionRatio * 100 ) + '%'
          //     })
          //   }
          // })
          
          if (val.taskId) {
            this.getTaskDetail(val.taskId)
          }
					if (val.file) {
						this.purchaseFile = val.file.split(',')
					}
					if (val.oneResultFile) {
						this.oneAttachment = val.oneResultFile.split(',')
					}
					if (val.twoHostResultFile) {
						this.twoAttachment = val.twoHostResultFile.split(',')
					}
				}
			},
			immediate: true
		},
		formDataHistory: {
			handler (val) {
				if (val) {
					this.getHistoryList()
				}
			},
			immediate: true
		}
	},
	methods: {
		// 获取列表
		getHistoryList() {
			var params = { processInstanceId: this.formDataHistory.procInsId };// 查询条件
			getAction(this.url.historyList, params).then(res => {
				if (res.success) {
					this.dataHistorySource = res.result.records || res.result
				}
			})
		},

    // 获取任务信息详情
    getTaskDetail (id) {
      var param = {
        id
      }
      getAction('/api/erp/omc/project/erpOmcProjectTaskFinal/queryPageList', param).then((res) => {
          if (res.success) {
            if (res.result.records && res.result.records.length) {
              this.$set(this.formData, 'taskId_dictText', res.result.records[0].billNo)
            }
          }
        })
    },

    initDictConfig() {

      initDictOptions('erp_employee_file,name,id').then((res) => {
          if (res.success) {
            this.$set(this.dictOptions, 'empId', res.result)
          }
        })
      
        initDictOptions('erp_omc_team_manager,alias_name,id').then((res) => {
          if (res.success) {
            this.$set(this.dictOptions, 'teamId', res.result)
          }
        })
        initDictOptions('erp_omc_project,project_name,id').then((res) => {
          if (res.success) {
            this.$set(this.dictOptions, 'projectId', res.result)
          }
        })
        initDictOptions('erp_omc_project_task,category_name,id').then((res) => {
          if (res.success) {
            this.$set(this.dictOptions, 'taskId', res.result)
          }
        })
        initDictOptions('yjgsnd').then((res) => {
          if (res.success) {
            this.$set(this.dictOptions, 'yjgsYear', res.result)
          }
        })
        initDictOptions('tdnd_type').then((res) => {
          if (res.success) {
            this.$set(this.dictOptions, 'feeYear', res.result)
          }
        })
        initDictOptions('approval_level').then((res) => {
          if (res.success) {
            this.$set(this.dictOptions, 'approvalLevel', res.result)
          }
        })
        initDictOptions('industry_coefficient').then((res) => {
          if (res.success) {
            this.$set(this.dictOptions, 'difficultyLevel', res.result)
          }
        })
        initDictOptions('erp_company_files,file_name,id').then((res) => {
          if (res.success) {
            this.$set(this.dictOptions, 'signUnit', res.result)
          }
        })
      },

		list () {
			if (!this.formData.id) {
				return false
			}
			var params = {
        mainId: this.formData.id,
        pageSize: 100
			}
			getAction(this.url.list, params).then(res => {
				if (res.success) {
						this.dataSource = res.result.records || res.result
						this.dataSource.forEach((item, index) => {
						item.key = index
					})
				}
      })
		},

		tableRowClass(record, index) {
			if (index == 0) {
				return 'rowClass';
			}
      return ''
    },

    getAddress (text) {
      if (!text) {
        return false
      }
      var areaList = text.split(',')
      var areaText = ''
      this.address.map(value => {
        if (areaList[0] && areaList[0] == value.code) {
          areaText = areaText + value.name + '/'
          if (value && value.children && value.children.length) {
            value.children.map(val => {
              if (areaList[1] && areaList[1] == val.code) {
                areaText = areaText + val.name + '/'

                if (val && val.children && val.children.length) {
                  val.children.map(va => {
                    if (areaList[2] && areaList[2] == va.code) {
                      areaText = areaText + va.name
                    }
                  })
                }
              }
            })
          }
        }
      })
      return areaText
    }
	}
};
</script>
<style lang="less" scoped>
.page{
	background: #ffffff;
	padding: 19px 28px 0 28px;
	width: 750px;
	.print_title{
		font-size: 15px;
		font-family: Alibaba PuHuiTi 2.0;
		font-weight: normal;
		color: #000000;
		display: flex;
		align-items: center;
		justify-content: center;
		margin-bottom: 9px;
	}
	.title {
		background: #EEEEEE;
		font-size: 13px;
		font-family: Alibaba PuHuiTi 2.0;
		font-weight: normal;
		color: #000000;
		padding: 11px 9px;
	}
	.title_table{
		font-size: 13px;
		font-family: Alibaba PuHuiTi 2.0;
		font-weight: normal;
		color: #000000;
	}
}
/deep/ .rowClass{
	font-size: 10px;
	font-family: Alibaba PuHuiTi 2.0;
	font-weight: normal;
	color: #000000;
}
/deep/ .ant-table-thead th{
	font-size: 10px;
	font-family: Alibaba PuHuiTi 2.0;
	font-weight: normal;
	color: #000000;
}
/deep/ .ant-table-thead tr{
	background: #EEEEEE;
}
/deep/ .ant-table-small > .ant-table-content > .ant-table-body {
    margin: 0 0px;
}
/deep/ .ant-table-body tr {
	font-size: 10px;
	font-family: Alibaba PuHuiTi 2.0;
	font-weight: normal;
	color: #000000;
}
/deep/ .ant-table-body tr td {
    word-wrap:break-word;
    word-break:break-all;
  }
.content {
  font-size: 13px;
}
</style>
